<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>虚拟机使用申请管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {
            //隐藏div
            $("#reason").hide();
            //给div添加change事件
            $("#checkFlag").change(function () {
                if ($(this).val() == '3') {
                    $("#reason").show();
                } else {
                    $("#reason").hide();
                }
            })
            //$("#name").focus();
            $("#inputForm").validate({
                submitHandler: function (form) {
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function (error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li><a href="${ctx}/biz/bizVmApply/">虚拟机使用申请列表</a></li>
    <li class="active"><a href="${ctx}/biz/bizVmApply/checkForm?id=${bizVmApply.id}">虚拟机使用申请<shiro:hasPermission
            name="biz:bizVmApply:edit">${not empty bizVmApply.id?'审核':'添加'}</shiro:hasPermission><shiro:lacksPermission
            name="biz:bizVmApply:edit">查看</shiro:lacksPermission></a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="bizVmApply" action="${ctx}/biz/bizVmApply/check" method="post"
           class="form-horizontal">
    <form:hidden path="id"/>
    <sys:message content="${message}"/>
    <div class="control-group">
        <label class="control-label">名称：</label>
        <div class="controls">
            <form:input path="name" htmlEscape="false" maxlength="100" class="input-xlarge required" readonly="true"/>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">使用开始时间：</label>
        <div class="controls">
            <input name="applyStartDate" type="text" readonly="readonly" maxlength="20"
                   class="input-medium Wdate required"
                   value="<fmt:formatDate value="${bizVmApply.applyStartDate}" pattern="yyyy-MM-dd HH:mm"/>"/>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">使用结束时间：</label>
        <div class="controls">
            <input name="applyEndDate" type="text" readonly="readonly" maxlength="20"
                   class="input-medium Wdate required"
                   value="<fmt:formatDate value="${bizVmApply.applyEndDate}" pattern="yyyy-MM-dd HH:mm" />"/>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">申请原因：</label>
        <div class="controls">
            <form:input path="applyReason" htmlEscape="false" maxlength="100" class="input-xlarge " readonly="true"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">申请人编号：</label>
        <div class="controls">
            <form:input path="applyId" htmlEscape="false" maxlength="64" class="input-xlarge required" readonly="true"/>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">申请人身份证号：</label>
        <div class="controls">
            <form:input path="applyIdCard" htmlEscape="false" maxlength="18" class="input-xlarge required"
                        readonly="true"/>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">申请人姓名：</label>
        <div class="controls">
            <form:input path="applyName" htmlEscape="false" maxlength="100" class="input-xlarge required"
                        readonly="true"/>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">备注信息：</label>
        <div class="controls">
            <form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge"
                           readonly="true"/>
        </div>
    </div>
   <%-- <div class="control-group">
        <label class="control-label">审核人编号：</label>
        <div class="controls">
            <form:input path="checkId" htmlEscape="false" maxlength="64" class="input-xlarge" readonly="true"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">审核人姓名：</label>
        <div class="controls">
            <form:input path="checkName" htmlEscape="false" maxlength="100" class="input-xlarge" readonly="true"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">审核时间：</label>
        <div class="controls">
            <input name="checkDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
                   value="<fmt:formatDate value="${bizVmApply.checkDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
        </div>
    </div>--%>
    <div class="control-group">
        <label class="control-label">审核标记：</label>
        <div class="controls">
            <select name="checkFlag" id="checkFlag" class="input-xlarge required">
                <option value="">请选择</option>
                <option value="2">通过</option>
                <option value="3">不通过</option>
                    <%--<form:options items="${fns:getDictList('check_flag')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
            </select>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <div class="control-group" id="reason">
        <label class="control-label">审核未通过原因：</label>
        <div class="controls">
            <form:textarea path="checkReason" htmlEscape="false" maxlength="100"  class="input-xlarge required"/>
        </div>
    </div>
    <div class="form-actions">
        <shiro:hasPermission name="biz:bizVmApply:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
    </div>
</form:form>
</body>
</html>